#ifndef _CAR_TASK_H
#define _CAR_TASK_H

struct mpu6050_data{
	short acc_x;
	short acc_y;
	short acc_z;
	
	short gyro_x;
	short gyro_y;
	short gyro_z;
	
	float pitch;
	float roll;
	float yaw;
	
};

// 卡尔曼滤波器
typedef struct Kalman_Filter{
	float x_last;
	float P_now;
	float P_last;
	float K;
	float R_cov;
	float Q_cov;
	float out;
}KF_Struct;

extern struct mpu6050_data outMpu;

void Car_Task_200HZ(void);
void Car_Task_100HZ(void);
void Car_Task_5HZ(void);
void HC_SRC04_Start(void);
void Car_Task_Interaction(void);
void IR_Scan_Task(void);

void KFS_Struct_Init(KF_Struct* KFS);
float KMFilter(KF_Struct* KFS, float data);
#endif
